from pathlib import Path
from core.detector import BaseOSDetector

class OpenSUSEDetector(BaseOSDetector):
    def detect(self) -> bool:
        return Path("/etc/SuSE-release").exists() or \
               Path("/etc/os-release").read_text().find("openSUSE") != -1

    def get_version(self) -> str:
        if Path("/etc/os-release").exists():
            os_release = self.get_os_release()
            return os_release.get("VERSION_ID", "unknown")
        return "unknown"